﻿<Application x:Class="ULSDeobfuscator.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ULSDeobfuscator="clr-namespace:ULSDeobfuscator"
             xmlns:mvvmHelpers="clr-namespace:Elca.MvvmHelpers"
             StartupUri="MainWindow.xaml"
             ShutdownMode="OnExplicitShutdown">
    
    <Application.Resources>
        
        <!-- Splitter look found at: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/67687d1d-5bd8-4f25-8c44-2311dd8db67b -->
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" x:Key="panelBackgroundBrush">
            <LinearGradientBrush.GradientStops>
                <GradientStop Color="#FFE3EFFF" Offset="0" />
                <GradientStop Color="#FFAFD2FF" Offset="1" />
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <Style TargetType="{x:Type GridSplitter}" x:Key="HorizontalGridSplitter">
            <Setter Property="FrameworkElement.Height" Value="8"/>
            <Setter Property="TextElement.Foreground" Value="#FF204D89" />
            <Setter Property="Border.BorderBrush" Value="#FF6593CF" />
            <Setter Property="Panel.Background" Value="{StaticResource panelBackgroundBrush}" />
            <Setter Property="Border.BorderThickness" Value="0,1,0,0" />
            <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
            <Setter Property="UIElement.Focusable" Value="False" />
            <Setter Property="Control.Padding" Value="7,7,7,7" />
            <Setter Property="FrameworkElement.Cursor" Value="SizeNS" />
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderThickness="{TemplateBinding Border.BorderThickness}" 
                                BorderBrush="{TemplateBinding Border.BorderBrush}" 
                                Background="{TemplateBinding Panel.Background}">
                            <Border BorderThickness="1,1,0,0" 
                                    BorderBrush="{StaticResource panelBackgroundBrush}">
                                <Canvas Width="19" Height="3">
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="1" Canvas.Top="0" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="5" Canvas.Top="0" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="9" Canvas.Top="0" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="13" Canvas.Top="0" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="17" Canvas.Top="0" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="0" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="4" Canvas.Top="0" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="8" Canvas.Top="0" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="12" Canvas.Top="0" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="16" Canvas.Top="0" />
                                </Canvas>
                            </Border>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type GridSplitter}" x:Key="VerticalGridSplitter">
            <Setter Property="FrameworkElement.Width" Value="8"/>
            <Setter Property="TextElement.Foreground" Value="#FF204D89" />
            <Setter Property="Border.BorderBrush" Value="#FF6593CF" />
            <Setter Property="Panel.Background" Value="{StaticResource panelBackgroundBrush}" />
            <Setter Property="Border.BorderThickness" Value="0,1,0,0" />
            <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
            <Setter Property="UIElement.Focusable" Value="False" />
            <Setter Property="Control.Padding" Value="7,7,7,7" />
            <Setter Property="FrameworkElement.Cursor" Value="SizeWE" />
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderThickness="{TemplateBinding Border.BorderThickness}" 
                                BorderBrush="{TemplateBinding Border.BorderBrush}" 
                                Background="{TemplateBinding Panel.Background}">
                            <Border BorderThickness="1,1,0,0" 
                                    BorderBrush="{StaticResource panelBackgroundBrush}">
                                <Canvas Width="3" Height="19">
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="1" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="5" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="9" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="13" />
                                    <Rectangle Fill="{StaticResource panelBackgroundBrush}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="17" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="0" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="4" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="8" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="12" />
                                    <Rectangle Fill="{TemplateBinding TextElement.Foreground}" Width="2" Height="2" Canvas.Left="0" Canvas.Top="16" />
                                </Canvas>
                            </Border>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="LargeButtonStyle"
               TargetType="Button">
            <Setter Property="Height" Value="25" />
            <Setter Property="Width" Value="80" />
        </Style>

        <DataTemplate DataType="{x:Type ULSDeobfuscator:FilterChoice}">
            <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}"
                        Margin="3"
                        Visibility="{Binding Visibility}">
                <CheckBox.Content>
                    <TextBlock Text="{Binding ItemName, Mode=OneTime}"
                                Padding="5,0,0,0" />
                </CheckBox.Content>
            </CheckBox>
        </DataTemplate>

        <BooleanToVisibilityConverter x:Key="Bool2VisibilityConverter"/>
        <mvvmHelpers:CommandToVisibilityConverter x:Key="Command2VisibilityConverter"/>
    </Application.Resources>
</Application>
